<script setup>
import {ref} from "vue";
import orderList from './views/orderList.vue'

const Module = [
  {
    title: '推介',
    classifyId: 5
  }, {
    title: '食品',
    classifyId: 0
  }, {
    title: '运动',
    classifyId: 1
  }, {
    title: '手机',
    classifyId: 2
  }, {
    title: '电脑',
    classifyId: 3
  }, {
    title: '家具',
    classifyId: 4
  }
]
const active = ref(0)
const navigateTo = () => {
  uni.navigateTo({
    url: '/pages/search/search'
  });
}
</script>

<template>
  <view class="orders">
    <view class="search">
      <van-search
          input-align="center"
          placeholder="Iphone 15 PRO MAX 1TB 远峰蓝"
          readonly
          @click-input="navigateTo"
      />
    </view>
    <van-tabs v-model:active="active" class="tabs" swipeable animated>
      <van-tab
          v-for="(v,i) in Module"
          :key="i"
          :title="v.title"
          class="tab"
          replace
      >
        <order-list :classify-id="v.classifyId" class="item"></order-list>
      </van-tab>
    </van-tabs>
  </view>
</template>

<style scoped>
.orders {
  width: 100%;
  height: calc(100vh - 94px);
  .tabs {
    .tab {
      .item {
        height: calc(100vh - 202px);
      }
    }
  }
}
</style>